<%@ page import="java.sql.*" contentType="text/html;charset=windows-1252"%>
<%

 //making connection
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   String url = "jdbc:odbc:iranhk";
   Connection con = DriverManager.getConnection(url, "iranhk", "iranhk");

 //get result of search 
 PreparedStatement pst=con.prepareStatement(
   "select   tb_msgs.id,tb_msgs.name name,tb_members.name author,tb_msgs.dat,tb_msgs.text, "+
              "tb_articles.id rel_art_id,tb_articles.name rel_art, "+
              "tb_tools.id rel_tool_id,tb_tools.name rel_tool, "+
              "tb_msgs2.id rel_mess_id,tb_msgs2.name rel_mess "+
     "from   tb_msgs,tb_members,tb_tools,tb_articles,tb_msgs tb_msgs2 "+
     "where "+
       "tb_msgs.fk_author_id=tb_members.id and "+
       "tb_msgs.fk_rel_art=tb_articles.id(+) and "+
       "tb_msgs.fk_rel_tool=tb_tools.id(+) and "+
       "tb_msgs.fk_rel_mess=tb_msgs2.id(+)  "+
       "order by dat",
       ResultSet.TYPE_SCROLL_INSENSITIVE,
       ResultSet.CONCUR_UPDATABLE       
 );

     ResultSet rst=pst.executeQuery();  
     int r=1;
     session.setAttribute("resultSet",rst);
      rst.absolute(1);
      while (rst.next()){r++;}
      session.setAttribute("resultSetRowsCount",new Integer(r));
     rst.beforeFirst();
     //out.print(pst.toString());
     /*while (rst.next()){ 
      out.print(rst.getString("NAME"));
    }*/
%>

<jsp:include page="../displayer/messages.jsp" flush="true">
  <jsp:param name="PAGENUM" value="1"/>
</jsp:include> 